<%
  if @contact.is_spanish? then  str_and = "y" else str_and = "and" end

  countries = ""
  first = true
  @news_letter.countries.each_index { |i|
    if first
      countries = "#{@news_letter.countries[i].name}"
      first = false
    else
      if i == @news_letter.countries.size-1
        countries += " #{str_and} #{@news_letter.countries[i].name}"
      else
        countries += ", #{@news_letter.countries[i].name}"
      end
    end
  }
%>


<div id="marco" style="width:90%;min-width:660px;">
  <div id="logo" style="font-family: Calibri, Arial, 'Arial Black';font-size: 18pt;font-weight: bolder;color: #6C0;background-color:#333;text-align: left;vertical-align: middle;padding: 2pt;height:25px;border-bottom: #FC0 medium  solid;">
    <font color="#FFFFFF">Retta</font>Libros<font size="-2" color="#FFFFFF">.com</font>
  </div>

  <div id="contenido" style="margin:0 0 5pt 0;border-bottom: 1pt #999 dotted;">
      <h3 style="font-family: Calibri, Arial, 'Arial Black';font-size: 10pt;font-weight: normal;margin: 2px;text-align: left;">
        <%= "#{@contact.regard.description} #{@contact.treatment.description} #{@contact.first_name} #{@contact.last_name}" %> :<br />
        <% if @contact.is_spanish? %>
          Disponemos para la venta una selección de <%= @materials.size %> libros de <%= countries %>. <%=@news_letter.optional_text_spanish%><br />
          Aceptamos pedidos y reservas por e-mail.<br />
          Saludos cordiales, <br />
          <br />
          RettaLibros<br />
          En libros de <%= countries %>, los mejores precios y el mejor servicio.
        <% else %>
          We have for sale a selection of <%=@materials.size%> books of <%= countries %>. <%=@news_letter.optional_text_english%><br />
          We accept orders and reservations via e-mail.<br />
          Best regards, <br />
          <br />
          RettaLibros<br />
          In books of <%= countries %>, the best prices and best service.
        <% end %>
      </h3>
  </div>

  <div id="contenido" style="margin:0 0 5pt 0;border-bottom: 1pt #999 dotted;">
    <h3 style="font-family: Calibri, Arial, 'Arial Black';font-size: 10pt;font-weight: normal;margin: 2px;text-align: left;">
      <% if @contact.is_spanish? %>
        Lista: <%= "#{@news_letter.created_at.day}#{@news_letter.created_at.month}#{@news_letter.created_at.year}" %> | Titulo: <%= @news_letter.subject_mail_spanish %> | Paises : <%= countries %> | Cantidad de materiales: <%= @materials.size %>
      <% else %>
        List: <%= "#{@news_letter.created_at.day}#{@news_letter.created_at.month}#{@news_letter.created_at.year}" %> | Title: <%= @news_letter.subject_mail_english %> | Countries : <%= countries %> | Materials count: <%= @materials.size %>
      <% end %>
    </h3>
  </div>

  <% index = 0 %>
  <% @materials.each do |material| %>
    <% index += 1 %>
    <div>
      <%=render :partial=>'materials/material_info_for_news_mail_html', :locals => {:index => index, :material => material} %>
    </div>
  <% end %>

  <div id="contenido" style="margin:0 0 5pt 0;border-bottom: 1pt #999 dotted;">
    <h5 style="font-family: Calibri, Arial, 'Arial Black';font-size: 12px;margin: 2px;text-align: center;">RettaLibros</h5>
    <h5 style="font-family: Calibri, Arial, 'Arial Black';font-size: 12px;margin: 2px;text-align: center;"> Store address: Paysandu 1838. Montevideo, 11200. Uruguay |  Mailing address: P.O. Box 669236. Miami, FL 33166. USA</h5>
    <h5 style="font-family: Calibri, Arial, 'Arial Black';font-size: 12px;margin: 2px;text-align: center;">Phone: (598) 2403 0027 | Fax: (598) 2401 5954 | Email: contacto@rettalibros.com</h5>
  </div>
